<!DOCTYPE html>
<html lang="zh">
{include file="public/head"}
<link rel="stylesheet" type="text/css" href="/static/admin/js/webuploader/webuploader.css">
<body>
<div class="container-fluid">
  <div class="row">
    <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <div class="card-title">下单用户信息</div>
        </div>
        <div class="card-body">
            <div class="d-flex">
              <img src="{$user_info.avatar}" class="rounded-circle me-3" style="width: 80px;height: 80px">
            </div>
            <hr>
            <div class="mb-2">
              <label>下单用户名：</label>
              <label>{$user_info.username}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>用户信息：</label>
              <label>邮箱：{$user_info.mail} ; 学校：{$user_info.school} ; 专业：{$user_info.major} ; 年级：{$user_info.grade} ; 
              排名：{$user_info.rank} </label>
            </div>
            <hr>
            <div class="mb-2">
              <label>能力：</label>
              <label>GPA：{$user_info.gpa} ; 托福：{$user_info.toefl} ; 雅思：{$user_info.ielts} ; LSAT：{$user_info.lsat} ; GRE{$user_info.gre}  </label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>交换项目：</label>
              <label>{$user_info.exchange_country} - {$user_info.exchange_project} - {$user_info.exchange_time}</label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>学业：</label>
              <label>本科：{$user_info.ug_degree} - {$user_info.ug_major} - {$user_info.ug_graduation};  研究生：{$user_info.gd_degree} - {$user_info.gd_major} - {$user_info.gd_graduation}  </label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>目标学校：</label>
              <label>{$user_info.target_school}; 目标专业：{$user_info.target_major}</label>
            </div> 
            <hr>
        </div>
      </div>
    </div>

        <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <div class="card-title">订单详情</div>
        </div>
        <div class="card-body">
            <div class="mb-2">
              <label>订单单号：</label>
              <label>{$order_info.order_data.order_no}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>服务类型：</label>
              <label>{$order_info.order_data.service_name}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>订单备注：</label>
              <label>{$order_info.order_data.remark}</label>
            </div>
            <hr>
        </div>
      </div>
    </div>

      </div>

      <div class="row">

        <div class="col-lg-12">
          <div class="card">
            <header class="card-header">
              <div class="card-title">订单信息</div>
            </header>
            <div class="card-body">
              <form class="row" id="common_form" action="{$action}" method="post">
                <div class="mb-3 col-md-12">
                  <div class="mb-3 col-md-12">
                    <label for="expected_time" class="form-label">
                    <h6>第一步：待用户提交意向信息，给出选校清单</h6>
                    </label>
                    {if !empty($order_info.order_server_data.ug_school) && !empty($order_info.order_server_data.user_name)}
                    <div class="mb-3 col-md-3">
                      <label for="username" class="form-label">用户名：</label>
                      <input type="text" class="form-control" value="{$order_info.order_server_data.user_name}" />
                    </div>
                    <div class="mb-3">
                      <label for="upload_size" class="form-label">本科项目：</label>
                      <div class="row">
                        <div class="col">
                          <label for="inputZip" class="form-label">学校：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.ug_school}" aria-label="ug_school">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.ug_major}" aria-label="ug_major">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业方向：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.ug_orientation}" aria-label="ug_orientation">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">毕业时间：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.ug_graduation}" aria-label="ug_graduation">
                        </div>
                      </div>
                    </div>

                    <div class="mb-3">
                      <label for="upload_size" class="form-label">研究生项目：</label>
                      <div class="row">
                        <div class="col">
                          <label for="inputZip" class="form-label">学校：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.gd_school}" aria-label="gd_school">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.gd_major}" aria-label="gd_major">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业方向：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.gd_orientation}" aria-label="gd_orientation">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">毕业时间：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.gd_graduation}" aria-label="gd_graduation">
                        </div>
                      </div>
                    </div>

                    <div class="mb-3">
                      <label for="upload_size" class="form-label">交换项目：</label>
                      <div class="row">
                        <div class="col">
                          <label for="inputZip" class="form-label">项目名称：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.exchange_project}" aria-label="exchange_project">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">起止时间：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.exchange_time}" aria-label="exchange_time">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">地点：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.exchange_area}" aria-label="exchange_area">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">学校：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.exchange_school}" aria-label="exchange_school">
                        </div>
                      </div>
                    </div>
                    <div class="mb-3">
                      <div class="row">
                        <div class="col">
                          <label for="inputZip" class="form-label">TOEFL：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.toefl}" aria-label="toefl">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">LSAT：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.lsat}" aria-label="lsat">
                        </div>
                      </div>
                    </div>
                    <div class="mb-3">
                      <div class="row">
                        <div class="col">
                          <label for="inputZip" class="form-label">意向位置：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.direction_location}" aria-label="direction_location">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业排名：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.rank}" aria-label="rank">
                        </div>
                        <div class="col">
                          <label for="inputZip" class="form-label">专业方向：</label>
                          <input type="text" class="form-control" value="{$order_info.order_server_data.major_target}" aria-label="major_target">
                        </div>
                      </div>
                    </div>
                    <div class="input-group mb-3">
                      <label for="expected_time" class="form-label">是否对2年制项目感兴趣（包含1年法律英语学校）：</label>
                      {if $order_info.order_server_data.is_interested == 1}
                      <span class="text-success">感兴趣</span>
                      {else /}
                      <span>不感兴趣</span>
                      {/if}
                    </div>
                    <div class="mb-3 col-md-12">
                      <label class="form-label">用户提交的学校清单：</label>
                      {volist name=":schoolList()" id="v"}
                      <div class="form-check">
                        <input class="form-check-input" type="checkbox" id="school_{$v.id}" {in name="$v.id" value="$order_info.order_server_data.user_choice_school"}checked{/in}>
                        <label class="form-check-label" for="school_{$v.id}">
                          {$v.name}
                        </label>
                      </div>
                      {/volist}
                    </div>
                    <div class="mb-3 col-md-12">
                      <label class="form-label">用户提交的其他学校：</label>
                      <textarea class="form-control" rows="6" style="width:70%">{$order_info.order_server_data.user_choice_other_school}</textarea>
                    </div>
                    <div class="mb-3 col-md-12">
                      <label class="form-label">其他补充：</label>
                      <textarea class="form-control" rows="6" style="width:70%">{$order_info.order_server_data.other_content}</textarea>
                    </div>

                    <input type="hidden" name="message_step" value="12">
                    <div class="mb-3 col-md-12">
                      <label class="form-label">请选择学校清单：</label>
                      {volist name=":schoolList()" id="v"}
                      <div class="form-check">
                        <input class="form-check-input" type="checkbox" name="expert_choice_1[]" value="{$v.id}" id="school_{$v.id}" {in name="$v.id" value="$order_info.order_server_data.expert_choice_1"}checked{/in}>
                        <label class="form-check-label" for="school_{$v.id}">
                          {$v.name}
                        </label>
                      </div>
                      {/volist}

                      <label class="form-label">其他学校补充：</label>
                      <textarea class="form-control" rows="6" name="expert_other_choice_1" style="width:70%">{$order_info.order_server_data.expert_other_choice_1}</textarea>
                    </div>
                    {/if}
                  </div>

                  {if !empty($order_info.order_server_data.user_opinion_1)}
                  <div class="mb-3 col-md-12">
                    <label for="meeting_link" class="form-label">
                    <h6>第二步：用户提出修改建议，重新选择学校清单</h6>
                    </label>
                    <textarea class="form-control" rows="6" style="width:70%">{$order_info.order_server_data.user_opinion_1}</textarea>
                    {if !empty($order_info.order_server_data.user_opinion_img_1)}
                    <br />
                    <label class="form-label">图片附件：</label>
                    <div class="mb-2">
                      <label>
                        {volist name="order_info.order_server_data.user_opinion_img_1" id="v"}
                        <a href="{$v}" target="_blank">
                          <img src="{$v}" style="width: 240px;height: 240px">
                        </a>
                        {/volist}
                      </label>
                    </div>
                    {/if}
                    {if !empty($order_info.order_server_data.user_opinion_file_1)}
                    <label class="form-label">文件附件：</label>
                    <div class="mb-2">
                      <label>
                        {volist name="order_info.order_server_data.user_opinion_file_1" id="v" key="k"}
                        <a href="{$v}" class="link-primary" target="_blank">({$k})：{$v}</a>
                        {/volist}
                      </label>
                    </div>
                    {/if}
                  </div>

                  <input type="hidden" name="message_step" value="12">
                  <div class="mb-3 col-md-12">
                      <label class="form-label">请选择学校清单：</label>
                      {volist name=":schoolList()" id="v"}
                      <div class="form-check">
                        <input class="form-check-input" type="checkbox" name="expert_choice_2[]" value="{$v.id}" id="school_{$v.id}" {in name="$v.id" value="$order_info.order_server_data.expert_choice_2"}checked{/in}>
                        <label class="form-check-label" for="school_{$v.id}">
                          {$v.name}
                        </label>
                      </div>
                      {/volist}
                      <label class="form-label">其他学校补充：</label>
                      <textarea class="form-control" rows="6" name="expert_other_choice_2" style="width:70%">{$order_info.order_server_data.expert_other_choice_2}</textarea>
                    </div>
                  {/if}

                  {if !empty($order_info.order_server_data.user_opinion_2)}
                  <div class="mb-3 col-md-12">
                    <label for="meeting_link" class="form-label">
                    <h6>第三步：用户提出修改建议，重新选择学校清单</h6>
                    </label>
                    <textarea class="form-control" rows="6" style="width:70%">{$order_info.order_server_data.user_opinion_2}</textarea>
                    {if !empty($order_info.order_server_data.user_opinion_img_2)}
                    <br />
                    <label class="form-label">图片附件：</label>
                    <div class="mb-2">
                      <label>
                        {volist name="order_info.order_server_data.user_opinion_img_2" id="v"}
                        <a href="{$v}" target="_blank">
                          <img src="{$v}" style="width: 240px;height: 240px">
                        </a>
                        {/volist}
                      </label>
                    </div>
                    {/if}
                    {if !empty($order_info.order_server_data.user_opinion_file_2)}
                    <label class="form-label">文件附件：</label>
                    <div class="mb-2">
                      <label>
                        {volist name="order_info.order_server_data.user_opinion_file_2" id="v" key="k"}
                        <a href="{$v}" class="link-primary" target="_blank">({$k})：{$v}</a>
                        {/volist}
                      </label>
                    </div>
                    {/if}
                  </div>

                  <input type="hidden" name="message_step" value="12">
                  <div class="mb-3 col-md-12">
                      <label class="form-label">请选择学校清单：</label>
                      {volist name=":schoolList()" id="v"}
                      <div class="form-check">
                        <input class="form-check-input" type="checkbox" name="expert_choice_3[]" value="{$v.id}" id="school_{$v.id}" {in name="$v.id" value="$order_info.order_server_data.expert_choice_3"}checked{/in}>
                        <label class="form-check-label" for="school_{$v.id}">
                          {$v.name}
                        </label>
                      </div>
                      {/volist}
                      <label class="form-label">其他学校补充：</label>
                      <textarea class="form-control" rows="6" name="expert_other_choice_3" style="width:70%">{$order_info.order_server_data.expert_other_choice_3}</textarea>
                    </div>
                  {/if}

                </div>
                {if !empty($order_info.order_server_data.expert_choice_3)}
                  <div class="mb-3 col-md-12">
                    <label for="meeting_link" class="form-label text-success">
                    <h6>第四步：最终选校清单已完成</h6>
                    </label>
                  </div>
                {/if}

                {if $order_info.order_data.status == 4}
                  <div class="mb-3 col-md-12">
                    <label for="meeting_link" class="form-label">
                    <h6>第五步：服务已完成，服务完成时间：{$order_info.order_data.complete_time}</h6>
                    </label>
                  </div>
                {/if}

                <input type="hidden" name="service_name" value="{$order_info.order_data.service_name}">
                <input type="hidden" name="id" value="{$order_info.order_data.id}">
                <input type="hidden" id="jump_url" value="self">

                {if $order_info.order_data.status == 1}
                <div class="mb-3 col-md-12">
                  <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                  <button type="button" class="btn btn-default" id="close_layer_open">返 回</button>
                  <button type="button" class="btn btn btn-teal" id="refresh_page">
                    <i class="mdi mdi-file-refresh"></i>刷新页面
                  </button>
                  <button type="button" class="btn btn-success order-complete">
                    <i class="mdi mdi-checkbox-marked-circle-outline"></i>设置订单为已完成
                  </button>
                </div>
                {/if}
              </form>
            </div>
          </div>
        </div>

      </div>

    </div>
    {include file="public/script"}
    <script type="text/javascript" src="/static/admin/laydate/laydate.js"></script>
    <script type="text/javascript" src="/static/admin/js/webuploader/webuploader.js"></script>
    <script type="text/javascript">
      var GUID = WebUploader.Base.guid();
            // 初始化Web Uploader
            var uploader = WebUploader.create({
                // 选完文件后，是否自动上传。
                auto: true,
                // swf文件路径
                swf: '/static/admin/js/webuploader/Uploader.swf',
                // 文件接收服务端。
                server: '/admin/common/chunkUpload',
                pick: {
                    id:'.filePicker',
                    //是否开启多个文件选择能力
                    multiple:false,
                },
                chunked: true,   //开启分片上传
                chunkSize: 2*1024*1024,   //分片大小
                threads: 1,               //上传并发数。允许同时最大上传进程数。
                formData: {guid: GUID, is_chunk:1},   //guid：任务号
                //fileSingleSizeLimit:30*1024*1024,  //文件大小限制
                fileVal:'file',
                duplicate: true,  //可否可以重复上传相同文件（如果为true，则相同文件可以重复上传）
            });
            
            uploader.on('uploadProgress',function (file,percentage ) {
                //显示进度条
                show_rate = Math.floor(percentage* 100);
                $('.progress-bar').css({width:show_rate+'%'});
                $('.progress-bar').text(show_rate+'%');
            })
            
            //上传成功时的回调方法
            uploader.on('uploadSuccess',function (file,res) {
                if(res.code == 100)
                {
                    //$('#file_path').html('&nbsp;&nbsp;&nbsp;&nbsp;文件地址：'+res.data.file_path);
                    //$('#file_path').attr('href', res.data.file_path);
                    $('#file_name').text('文件名称：'+res.data.file_name);
                    $('#file_size').html('&nbsp;&nbsp;&nbsp;&nbsp;文件大小：'+res.data.size);
                    $('#file_time').html('&nbsp;&nbsp;&nbsp;&nbsp;上传时间：'+res.data.time);
                }else{
                    
                }
            })
    </script>

    <script type="text/javascript">
      $(document).on("click",".del_more_file",function(){
    $(this).parent().remove();
})

            
            $('.order-complete').click(function(){
                layer.confirm('确定设置此订单为已完成吗?', function(index){
                    $.post('/admin/expertOrder/setOrderComplete',{id:{$order_info.order_data.id}},function(res)
                    {
                        if(res.code == 200)
                        {
                            showNotify(res.msg, 'success', 1000, 'mdi mdi-emoticon-happy', 'top', 'right', '{$action}');
            
                            $("#table").bootstrapTable('selectPage', $("#table").bootstrapTable("getOptions").pageNumber);  //跳转到此页
                        }else{
                            showNotify(res.msg, 'danger', 1000, 'mdi mdi-information-outline', 'top', 'right');
                        }
                    })
                    layer.close(index);
                })
            })
    </script>
  </body>
</html>